<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<meta charset="utf-8" />
<title>优惠券管理 - 新增优惠券</title>
<?php include($this->c['_homes']['_viewsHome'].'/_global/_head.php');?>
</head>
<!-- BEGIN BODY -->
<body class="page-header-fixed page-sidebar-fixed">
<!-- BEGIN HEADER -->
<?php include($this->c['_homes']['_viewsHome'].'/_global/head.php');?>
<!-- END HEADER -->
<div class="clearfix"></div>
<!-- BEGIN CONTAINER -->
<div class="page-container" > 
  <!-- BEGIN HORIZONTAL MENU PAGE SIDEBAR1 -->
  <?php include($this->c['_homes']['_viewsHome'].'/_global/menu.php');?>
  <!-- END BEGIN HORIZONTAL MENU PAGE SIDEBAR --> 
  <!-- BEGIN PAGE -->
  <div class="page-content"> 
    <!-- BEGIN PAGE HEADER-->
    <div class="row">
      <div class="col-md-12"> 
        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
        <h3 class="page-title"> 新增优惠券 </h3>
        <ul class="page-breadcrumb breadcrumb">
          <li> <i class="icon-home"></i> <a href="/manage">后台</a> <i class="icon-angle-right"></i> </li>
          <li> 优惠券管理 <i class="icon-angle-right"></i> </li>
          <li>新增优惠券</li>
        </ul>
        <!-- END PAGE TITLE & BREADCRUMB--> 
      </div>
    </div>
    <!-- END PAGE HEADER--> 
    <!-- BEGIN PAGE CONTENT-->
    
    <div class="row">
      <div class="col-md-12"> 
        <!-- BEGIN SAMPLE FORM PORTLET-->
        <div class="portlet box blue">
          <div class="portlet-title">
            <div class="caption"> <i class="icon-reorder"></i> 新增优惠券 </div>
            <div class="tools"> <a href="" class="collapse"></a> </div>
          </div>
          <div class="portlet-body form">
            <form method="post" class="form-horizontal" action="save" onsubmit="return chkfrm();">
              <input type="hidden" name="act" value="add" />
              <div class="form-body">      
               <div class="form-group">
                <label  class="col-md-2 control-label">商品ID<span class="required"></span></label>
                <div class="col-md-9">
                  <input type="text" name="goods_ids" id="goods_ids"  value="" class="form-control"  placeholder="输入商品ID 多个ID请用英文 , 隔开">
                  <span class="help-block">输入商品ID 多个ID请用英文 , 隔开例如：1,2</span>
                  </div>
              </div>
               <hr> 
       
                <div class="form-group">
                  <label class="col-md-2 control-label">抵扣金额</label>
                  <div class="col-md-3">
                    <input name="money"  id="money" class="form-control" value="0" maxlength="11" type="tel">
                    <span class="help-block">可以带有小数点，例如：6.66</span>
                  </div>
                </div>
                
                
                <div class="form-group">
                  <label class="col-md-2 control-label">最低消费金额要求</label>
                  <div class="col-md-3">
                    <input name="min_money" class="form-control" value="0" maxlength="11" type="tel">
                    <span class="help-block">消费金额达到多少可以使用，允许填写0，例如：10</span>
                  </div>
                </div> 
                <hr> 
                <div class="form-group">
                  <label class="col-md-2 control-label">发放数量</label>
                  <div class="col-md-3">
                    <input name="max_num" id="max_num" class="form-control" value="0" maxlength="11" type="tel">
                    <span class="help-block">优惠券最多被领取数量，例如：1000</span>
                  </div>
                </div>  
                <div class="form-group">
                <label  class="col-md-2 control-label">用户可领劵次数<span class="required"></span></label>
                <div class="col-md-3">
                  <input type="text" name="use_get_num" id="use_get_num"  value="0" class="form-control" maxlength="11"  placeholder="输入用户可领劵次数">
                  <span class="help-block"></span>
                  </div>
              </div>
                <div class="form-group">
                  <label class="col-md-2 control-label">有效期月数</label>
                  <div class="col-md-3">
                    <select class="form-control" name="expire_month">                      
                      <?php                      
                        for($i=1;$i<=24;$i++)
                        {                          
                          echo '<option value="'.$i.'">'.$i.'个月</option>';
                        }          
                      
                      ?>
                    </select>
                    <span class="help-block">有效期从领取时间起计算</span>
                  </div>
                </div>
                                <div class="form-group">
                  <label class="col-md-2 control-label">状态</label>
                  <div class="col-md-9">
                    <div class="radio-list">
                      <label class="radio-inline">
                      <div id="uniform-optionsRadios4" class="radio"><span class="">
                        <input name="status" id="optionsRadios4" value="1" checked type="radio">
                        </span></div>
                      <span class="label label-success">正常</span>
                      </label>
                      <label class="radio-inline">
                      <div id="uniform-optionsRadios5" class="radio"><span>
                        <input name="status" id="optionsRadios5" value="2"   type="radio">
                        </span></div>
                      <span class="label label-danger">禁用</span>
                      </label>
                    </div>
                  </div>
                </div>                                        
              </div>
              <div class="form-actions fluid">
                <div class="col-md-offset-2 col-md-9">
                  <button type="submit" class="btn blue">提交</button>
                </div>
              </div>
            </form>
          </div>
        </div>
        <!-- END SAMPLE FORM PORTLET--> 
        
      </div>
    </div>
    <!-- END PAGE CONTENT--> 
  </div>
  <!-- END PAGE --> 
</div>
<!-- END CONTAINER -->
<?php include($this->c['_homes']['_viewsHome'].'/_global/_footer.php');?>
<script>
var _users = <?=json_encode($this->data);?>;
jQuery(document).ready(function() {
    App.init();
    

});

function chkfrm() {
    
  if($("#money").prop("value")=="")
  {
    swal("请填写抵扣金额");
    return false;
  }
  else if(  parseFloat($("#money").prop("value")) ==0)
  {
    swal("抵扣金额必须大于0");
    return false;
  }

  if($("#max_num").prop("value")=="")
  {
    swal("请填写发放数量");
    return false;
  }
  else if(  parseInt($("#max_num").prop("value")) ==0)
  {
    swal("发放数量必须大于0");
    return false;
  }


   if(parseInt($("#use_get_num").prop("value")) ==0 || $("#use_get_num").prop("value")=="")
  {
    swal("可领取数量必须大于0");
    return false;
  }
  
}

</script>

<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>